<!DOCTYPE html>
<head xmlns:v-bind="http://www.w3.org/1999/xhtml" >
    <meta charset="UTF-8">
    <title>demo9监听属性</title>
  <script src="./js/vue.min.js"></script>

</head>

<body>
   <div id="app">
    <p style="font-size:25px;">计数器{{counter}}</p>
    <button @click="counter++" style="font-size:23px;">点我</button>
   </div>
   <script type="application/javascript">
     var vm = new Vue({
       el: "#app",
       data: {
         counter: 1
       }
     });
     vm.$watch('counter',function (nval,oval) {
       alert('计数器值变化:old['+oval+"]->new["+nval+"]")
     })

   </script>
</body>

</html>
